﻿using JWT.Common;
using JWT.MvcDemo.App_Start;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace JWT.MvcDemo.Controllers
{

    public class HomeController : Controller
    {
        //后期完善 可以创建个BaseController 让控制器去继承
        private readonly string LoginKey = ConfigurationManager.AppSettings["LoginKey"];
        public ActionResult Index()
        {
            Log4Help.Info("1111");
            Log4Help.Error("12345",null);
            ViewBag.Token = Request.Cookies.Get(LoginKey)?.Value;
            return View();
        }
        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return Json("Your application description page.",JsonRequestBehavior.AllowGet);
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }



        public ActionResult Error()
        {
            return Json("权限不足", JsonRequestBehavior.AllowGet);
        }

    }
}